/* eslint-disable */
import {hiprint} from 'vue-plugin-hiprint'

// 自定义设计元素1
export const aProvider = function (ops) {
  var addElementTypes = function (context) {
    context.removePrintElementTypes("tasksProviderModule");
    context.addPrintElementTypes(
      "tasksProviderModule",
      [
        new hiprint.PrintElementTypeGroup("模块", [
          {
            tid: 'tasksProviderModule.zd', title: '制单日期', data: '制单日期', type: 'text',
            options: {
              height: 17,
              fontSize: 16.5,
              fontWeight: "700",
              textAlign: "center",
            }
          },
          {
            tid: 'tasksProviderModule.th', title: '提货日期', data: '提货日期', type: 'text',
            options: {
              height: 16,
              fontSize: 15,
              fontWeight: "700",
              textAlign: "center",
            }
          },
          {
            tid: 'tasksProviderModule.js', title: '结算单号', data: '结算单号', type: 'text',
            options: {
              field: 'orderId',
              height: 16,
              fontSize: 6.75,
              fontWeight: "700",
              textAlign: "left",
              textContentVerticalAlign: "middle"
            }
          },
          {
            tid: 'tasksProviderModule.ht', title: '合同号', data: '合同号', type: 'text',
            options: {
              field: 'date',
              height: 16,
              fontSize: 6.75,
              fontWeight: "700",
              textAlign: "left",
              textContentVerticalAlign: "middle"
            }
          },
          {
            tid: 'tasksProviderModule.xsr', title: '销售人', data: '销售人', type: 'text',
            options: {
              height: 32,
              fontSize: 12,
              lineHeight: 18,
              fontWeight: "700",
              textAlign: "left",
              textContentVerticalAlign: "middle",
            }
          },
          {
            tid: 'tasksProviderModule.ghdw', title: '购货单位', data: '购货单位', type: 'text',
            options: {
              height: 32,
              fontSize: 12,
              lineHeight: 18,
              fontWeight: "700",
              textAlign: "left",
              textContentVerticalAlign: "middle",
            }
          },
          {
            tid: 'tasksProviderModule.ghxm', title: '购货项目', data: '购货项目', type: 'text',
            options: {
              height: 17,
              fontSize: 16.5,
              fontWeight: "700",
              textAlign: "center",
            }
          },
		  {
		    tid: 'tasksProviderModule.xslx', title: '销售类型', data: '销售类型', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.jylx', title: '交易类型', data: '交易类型', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.cn', title: '承诺付款日期', data: '承诺付款日期', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.wf', title: '我方单位', data: '我方单位', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.ssbk', title: '所属板块', data: '所属板块', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.xh', title: '销货仓库', data: '销货仓库', type: 'text',
		    options: {
		      height: 16,
		      fontSize: 15,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.jssl', title: '结算数量', data: '结算数量', type: 'text',
		    options: {
		      field: 'orderId',
		      height: 16,
		      fontSize: 6.75,
		      fontWeight: "700",
		      textAlign: "left",
		      textContentVerticalAlign: "middle"
		    }
		  },
		  {
		    tid: 'tasksProviderModule.jszl', title: '结算重量', data: '结算重量', type: 'text',
		    options: {
		      field: 'date',
		      height: 16,
		      fontSize: 6.75,
		      fontWeight: "700",
		      textAlign: "left",
		      textContentVerticalAlign: "middle"
		    }
		  },
		  {
		    tid: 'tasksProviderModule.jsje', title: '结算金额', data: '结算金额', type: 'text',
		    options: {
		      height: 32,
		      fontSize: 12,
		      lineHeight: 18,
		      fontWeight: "700",
		      textAlign: "left",
		      textContentVerticalAlign: "middle",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.jsfy', title: '结算费用', data: '结算费用', type: 'text',
		    options: {
		      height: 32,
		      fontSize: 12,
		      lineHeight: 18,
		      fontWeight: "700",
		      textAlign: "left",
		      textContentVerticalAlign: "middle",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.thfs', title: '提货方式', data: '提货方式', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.thfs', title: '提货人', data: '提货人', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.thdh', title: '提货电话', data: '提货电话', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.cych', title: '承运车号', data: '承运车号', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.shdz', title: '送货地址', data: '送货地址', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.jbr', title: '经办人', data: '经办人', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.zdr', title: '制单人', data: '制单人', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
		    tid: 'tasksProviderModule.bz', title: '备注', data: '备注', type: 'text',
		    options: {
		      height: 17,
		      fontSize: 16.5,
		      fontWeight: "700",
		      textAlign: "center",
		    }
		  },
		  {
            tid: 'tasksProviderModule.table', title: '商品明细',
            type: 'table',
            options: {
              field: 'table',
              tableHeaderRepeat: 'first',
              tableFooterRepeat: 'last',
              fields: [
                {text: '厂家', field: 'NAME'},
                {text: '品名', field: 'SL'},
                {text: '材质', field: 'GG'},
                {text: '规格(mm)', field: 'TM'},
                {text: '尺寸(mm)', field: 'DJ'},
                {text: '数量', field: 'JE'},
				{text: '单位', field: 'NAME'},
				{text: '计重方式', field: 'SL'},
				{text: '重量', field: 'GG'},
				{text: '单价', field: 'TM'},
				{text: '金额', field: 'DJ'},
				{text: '备注', field: 'JE'}
              ],
            },
            editable: true,
            columnDisplayEditable: true,//列显示是否能编辑
            columnDisplayIndexEditable: true,//列顺序显示是否能编辑
            columnTitleEditable: true,//列标题是否能编辑
            columnResizable: true, //列宽是否能调整
            columnAlignEditable: true,//列对齐是否调整
            isEnableEditField: true, //编辑字段
            isEnableContextMenu: true, //开启右键菜单 默认true
            isEnableInsertRow: true, //插入行
            isEnableDeleteRow: true, //删除行
            isEnableInsertColumn: true, //插入列
            isEnableDeleteColumn: true, //删除列
            isEnableMergeCell: true, //合并单元格
            columns: [
              [
                {title: '厂家', align: 'center', field: 'NAME', width: 150},
                {title: '品名', align: 'center', field: 'SL', width: 80},
                {title: '材质', align: 'center', field: 'GG', width: 80, checked: false},
                {title: '规格(mm)', align: 'center', field: 'TM', width: 100, checked: false},
                {title: '尺寸(mm)', align: 'center', field: 'DJ', width: 100},
                {title: '数量', align: 'center', field: 'JE', width: 100, checked: false},
				{title: '单位', align: 'center', field: 'NAME', width: 150},
				{title: '计重方式', align: 'center', field: 'SL', width: 80},
				{title: '重量', align: 'center', field: 'GG', width: 80, checked: false},
				{title: '单价', align: 'center', field: 'TM', width: 100, checked: false},
				{title: '金额', align: 'center', field: 'DJ', width: 100},
				{title: '备注', align: 'center', field: 'JE', width: 100, checked: false},
              ],
            ],
            footerFormatter: function (options, rows, data, currentPageGridRowsData) {
              if (data && data['totalCap']) {
                return `
				<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
              }
              return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
            },
          },
        ]),
        new hiprint.PrintElementTypeGroup("拖拽列表", [
          {
			tid: 'tasksProviderModule.text',
				title: '文本',
				data: '李四',
				type: 'text',
				options: {
					field: 'creater',
					height: 16,
					fontSize: 6.75,
					fontWeight: "700",
					textAlign: "left",
					textContentVerticalAlign: "middle"
				}
			},
			{
				tid: 'tasksProviderModule.longText',
				title: '长文',
				data: '处处充满创造性',
				type: 'text',
				options: {
					field: 'printDate',
					height: 16,
					fontSize: 6.75,
					fontWeight: "700",
					textAlign: "left",
					textContentVerticalAlign: "middle"
				}
			},
			
        ]),
        new hiprint.PrintElementTypeGroup("辅助", [
          {
            tid: 'tasksProviderModule.hline',
            title: '横线',
            type: 'hline'
          },
          {
            tid: 'tasksProviderModule.vline',
            title: '竖线',
            type: 'vline'
          },
          {
            tid: 'tasksProviderModule.rect',
            title: '矩形',
            type: 'rect'
          },
          {
            tid: 'tasksProviderModule.oval',
            title: '椭圆',
            type: 'oval'
          }
        ])
      ]);
  };
  return {
    addElementTypes: addElementTypes
  };
};

export default [{
	value: 'tasksProviderModule',
	f: aProvider()
}]
